classdef ziServerData < handle
    %ZISERVERDATA �˴���ʾ�йش����ժҪ
    %   �˴���ʾ��ϸ˵��
    
    properties
        name
        measured_data
        data_node
    end
    
    methods
        function obj = ziServerData(name, measured_data, nodeCell)
            %ZISERVERDATA ��������ʵ��
            %   �˴���ʾ��ϸ˵��
            obj.name = name;
            obj.measured_data = measured_data;
            obj.data_node = nodeCell;
        end
        
        function disp(obj)
            fprintf('[%s] has the following data:\n', obj.name);
            if isa(obj, 'EquipmentControl.ZI.ziServer.ziServerData.ziServerScopeModuleData')
                for k = 1:length(obj.data_node)                    
                    nodeStr = ['/' obj.device '/' obj.data_node{k}.toString() '/'];
                    fprintf('\tNode(%d) := %s \n', k, nodeStr);
                end
            else
                for k = 1:size(obj.data_node, 1)
                    nodeStr = ['/' obj.data_node{k, 1} '/' obj.data_node{k,2}.toDispString];
                    spaceStr = repmat(' ', 1, max(1, 35-length(nodeStr)));
                    fprintf('\tNode(%d) := %s %s [%d, %d, %d]\n', k, nodeStr, spaceStr, obj.data_node{k, 3});
                end
            end
        end
    end
    
    %%
    methods(Abstract)
        [tList, vList] = get_data(obj, device, ziNode)
        plot_data(obj, device, ziNode)
    end
end

